package com.summer.filesync.model.manager;

/** 系统维护结果 */
public class MaintenanceResult {
  private boolean success;
  private int tempFilesDeleted;
  private int versionsDeleted;
  private boolean databaseOptimized;
  private boolean indexRebuilt;
  private String errorMessage;
  private long elapsedTimeMs;
  private java.time.LocalDateTime startTime;
  private java.time.LocalDateTime endTime;

  public MaintenanceResult() {
    this.startTime = java.time.LocalDateTime.now();
  }

  public void complete() {
    this.endTime = java.time.LocalDateTime.now();
    this.elapsedTimeMs = java.time.Duration.between(startTime, endTime).toMillis();
  }

  // Getters and Setters
  public boolean isSuccess() {
    return success;
  }

  public void setSuccess(boolean success) {
    this.success = success;
  }

  public int getTempFilesDeleted() {
    return tempFilesDeleted;
  }

  public void setTempFilesDeleted(int tempFilesDeleted) {
    this.tempFilesDeleted = tempFilesDeleted;
  }

  public int getVersionsDeleted() {
    return versionsDeleted;
  }

  public void setVersionsDeleted(int versionsDeleted) {
    this.versionsDeleted = versionsDeleted;
  }

  public boolean isDatabaseOptimized() {
    return databaseOptimized;
  }

  public void setDatabaseOptimized(boolean databaseOptimized) {
    this.databaseOptimized = databaseOptimized;
  }

  public boolean isIndexRebuilt() {
    return indexRebuilt;
  }

  public void setIndexRebuilt(boolean indexRebuilt) {
    this.indexRebuilt = indexRebuilt;
  }

  public String getErrorMessage() {
    return errorMessage;
  }

  public void setErrorMessage(String errorMessage) {
    this.errorMessage = errorMessage;
  }

  public long getElapsedTimeMs() {
    return elapsedTimeMs;
  }

  public java.time.LocalDateTime getStartTime() {
    return startTime;
  }

  public java.time.LocalDateTime getEndTime() {
    return endTime;
  }
}
